package com.tuanzi.loan.business.entity;

import java.util.Collection;
import java.util.List;
import java.util.Map;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import com.tuanzi.loan.business.entity.system.DataPermission;
import com.tuanzi.loan.business.entity.system.Menu;
import com.tuanzi.loan.business.entity.system.Partner;
import com.tuanzi.loan.business.entity.system.Role;

import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = true)
public class LoginUser extends User {
	private static final long serialVersionUID = 207433234705960952L;

	private String userId;

	private String account;

	private String name;

	private String phone;

	private String email;

	private Partner partner;

	private List<String> permissionCodes;

	private List<Menu> menus;

	private List<Role> roles;

	private List<String> interceptUrls;

	private Map<String/* code */, DataPermission> dataPermissions;

	public LoginUser(String userId, String account, String name, String phone, String email, String username, Partner partner, List<String> permissionCodes,
			Map<String/* code */, DataPermission> dataPermissions, List<String> interceptUrls, List<Menu> menus, List<Role> roles, String password, boolean enabled,
			boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities) {
		super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
		this.userId = userId;
		this.account = account;
		this.name = name;
		this.phone = phone;
		this.email = email;
		this.partner = partner;
		this.permissionCodes = permissionCodes;
		this.menus = menus;
		this.roles = roles;
		this.interceptUrls = interceptUrls;
		this.dataPermissions = dataPermissions;
	}

}
